# frozen_string_literal: true

class RuleOutput < ApplicationRecord
  include Ordinalable

  belongs_to :general_rule, class_name: 'RuleEntity::GeneralRule'

  validates :name, presence: true

  def deep_clone_to_draft
    self.class.create! slice(:ordinal, :name, :value)
  end

  def deep_update(params)
    update! ordinal: params[:ordinal], name: params[:name], type: params[:type], value: params[:value]
  end

  def validate(_variable_type); end

  def fire(params)
    logger.debug { params }
    raise 'Unsupported feature.'
  end
end
